/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "georeferencesource")
@NamedQueries({
    @NamedQuery(name = "Georeferencesource.findAll", query = "SELECT g FROM Georeferencesource g"),
    @NamedQuery(name = "Georeferencesource.findByIdgeoreferencesource", query = "SELECT g FROM Georeferencesource g WHERE g.idgeoreferencesource = :idgeoreferencesource"),
    @NamedQuery(name = "Georeferencesource.findByGeoreferencesource", query = "SELECT g FROM Georeferencesource g WHERE g.georeferencesource = :georeferencesource")})
public class Georeferencesource implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idgeoreferencesource")
    private Integer idgeoreferencesource;
    @Column(name = "georeferencesource")
    private String georeferencesource;
    @JoinTable(name = "localitygeoreferencesource", joinColumns = {
        @JoinColumn(name = "idgeoreferencesource", referencedColumnName = "idgeoreferencesource")}, inverseJoinColumns = {
        @JoinColumn(name = "idlocalityelement", referencedColumnName = "idlocalityelement")})
    @ManyToMany(fetch = FetchType.LAZY)
    private List<Localityelement> localityelementList;
    @JoinTable(name = "geospatialgeoreferencesource", joinColumns = {
        @JoinColumn(name = "idgeoreferencesource", referencedColumnName = "idgeoreferencesource")}, inverseJoinColumns = {
        @JoinColumn(name = "idgeospatialelement", referencedColumnName = "idgeospatialelement")})
    @ManyToMany(fetch = FetchType.LAZY)
    private List<Geospatialelement> geospatialelementList;

    public Georeferencesource() {
    }

    public Georeferencesource(Integer idgeoreferencesource) {
        this.idgeoreferencesource = idgeoreferencesource;
    }

    public Integer getIdgeoreferencesource() {
        return idgeoreferencesource;
    }

    public void setIdgeoreferencesource(Integer idgeoreferencesource) {
        this.idgeoreferencesource = idgeoreferencesource;
    }

    public String getGeoreferencesource() {
        return georeferencesource;
    }

    public void setGeoreferencesource(String georeferencesource) {
        this.georeferencesource = georeferencesource;
    }

    public List<Localityelement> getLocalityelementList() {
        return localityelementList;
    }

    public void setLocalityelementList(List<Localityelement> localityelementList) {
        this.localityelementList = localityelementList;
    }

    public List<Geospatialelement> getGeospatialelementList() {
        return geospatialelementList;
    }

    public void setGeospatialelementList(List<Geospatialelement> geospatialelementList) {
        this.geospatialelementList = geospatialelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idgeoreferencesource != null ? idgeoreferencesource.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Georeferencesource)) {
            return false;
        }
        Georeferencesource other = (Georeferencesource) object;
        if ((this.idgeoreferencesource == null && other.idgeoreferencesource != null) || (this.idgeoreferencesource != null && !this.idgeoreferencesource.equals(other.idgeoreferencesource))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Georeferencesource[idgeoreferencesource=" + idgeoreferencesource + "]";
    }

}
